<?php 
class Db_hotel extends CI_Model{
	public  function __construct(){
		parent::__construct();
	}
	
	public function attrac_listcat(){
		$config['base_url'] = base_url().'manage_hotel/attraction_cat';
		$config['total_rows'] = $this->db->count_all("hotel_local_attraction_category");
		$config['per_page'] = 20;
		$config['full_tag_open'] = '<div class="pages">';
		$config['full_tag_close'] = '<div>';
		$this->pagination->initialize($config);
		$this->db->limit($config['per_page'],$this->uri->segment(3));
		$this->db->order_by("pkid", "desc");
		$res = $this->db->get('hotel_local_attraction_category');
		//==
		$no = $this->uri->segment(3)+1;
		$i = 1;
		$arr = $res->result_array();
		$cat = array();
		foreach ($arr as $P){
			if($i %2 == 0)
				$tmp['back']							="#FFFFFF";
			else
				$tmp['back']							="#F4F4F4";
			$i++;
			$tmp['no']							=$no;
			$tmp['pkid']						=$P['pkid'];
			$tmp['name_en']				=$P['name_en'];
			$tmp['name_zh_cn']			=$P['name_zh_cn'];
			$tmp['name_th']					=$P['name_th'];
			$cat[] = $tmp;
			$no = $no+1;
		}
		$num_row = $config['total_rows'];
		$pagelink  = $this->pagination->create_links();
		return array($cat,$num_row,$pagelink);
	}
	
	public function meal_listcat(){
		
	}
}
?>